package com.chiyoyo.multipay.framework.core.enums.transfer;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author chil
 * 转账类型枚举
 */
@AllArgsConstructor
@Getter
public enum PayTransferTypeEnum {

    ALIPAY_BALANCE(1, "支付宝余额"),
    WX_BALANCE(2, "微信余额"),
    BANK_CARD(3, "银行卡"),
    WALLET_BALANCE(4, "钱包余额");

    public interface WxPay {
    }

    public interface Alipay {
    }

    private final Integer type;
    private final String name;

//    public static final int[] ARRAYS = Arrays.stream(values()).mapToInt(PayTransferTypeEnum::getType).toArray();

    public static PayTransferTypeEnum typeOf(Integer type) {
        return Stream.of(values()).filter(item -> item.getType().equals(type)).findFirst().orElse(null);
    }

}
